/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lt.cj.core.filters;

import org.htmlparser.Node;
import org.htmlparser.NodeFilter;
import org.lt.cj.config.util.RegCheck;

/*
 * @author luohong
 */
public class ContentRegFilter implements NodeFilter {

    private String reg;

    public ContentRegFilter(String reg) {
        this.reg = reg;
    }

    public boolean accept(Node node) {

        RegCheck regChecker = RegCheck.getInstance();
        //提取以包含匹配字符串的链接
        boolean result = regChecker.checkNodeContent(node.toHtml(), reg);
        String s = node.toHtml();
        System.out.println(s);
        return result;
    }
}
